# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-dill
_pyname=dill
pkgver=0.3.7
pkgrel=1
pkgdesc="Python serializer supporting a broader range of types than pickle"
url="https://pypi.org/project/dill/"
arch="noarch"
license="BSD-3-Clause"
makedepends="python3 py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/uqfoundation/dill/releases/download/dill-$pkgver/dill-$pkgver.tar.gz"
builddir=$srcdir/$_pyname-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	export PYTHONPATH=build/lib
	for t in dill/tests/test*.py; do
		echo "$t"
		.testenv/bin/python3 "$t"
	done
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/dill/tests
}

sha512sums="
4b9cf70ca084102940fefbb9d3982a841b87fc3a21884af6b3574e3e4fa0ef62d6845a20ee326dfc479a4d2c545d3740f361d29e9115dd09d657489f43a3e2dd  dill-0.3.7.tar.gz
"
